package com.binyouwei.calculator

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.Scaffold
import androidx.compose.ui.Modifier
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.binyouwei.calculator.ui.AppPage
import com.binyouwei.calculator.ui.MainScreen
import com.binyouwei.calculator.ui.calculator.CalculatorScreen

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContent {
            val navController = rememberNavController()
            Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
                NavHost(navController = navController, startDestination = AppPage.Main.name) {
                    composable(AppPage.Main.name) { MainScreen(navController) }
                    composable(AppPage.Calculator.name) { CalculatorScreen() }
                }
            }
        }
    }
}
